<template>
	<view>
		<navigator v-for="(v, i) in list" :key="i" :url="'/pages/detail/detail?id=' + v.id">
			<list-item :item="v">
				<view slot="desc">{{v.desc}}</view>
			</list-item>
		</navigator>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				q: '',
				list: []
			};
		},
		onLoad(options) {
			const { q } = options;
			this.q = q;
			this.getList()
		},
		methods: {
			async getList() {
				const [error, resp] = await uni.request({
					url: 'http://localhost:3000/list',
					data: {
						q: this.q
					}
				})
				this.list = resp.data;
			}
		}
	}
</script>

<style lang="scss">

</style>
